package com.utils;

import redis.clients.jedis.Jedis;

/**
 * @author HuangSuip
 */
public class RedisUtils {

    private static Jedis JEDIS;

    static {
        JEDIS = new Jedis("10.0.0.224", 6379);
    }

    public static String setObject(String string) {
        String key = UUIDUtils.randomUUID();
        System.out.println(JEDIS.ping());
        JEDIS.set(key, string);
        return key;
    }

    public static String getObject(String key) {
        return JEDIS.get(key);
    }

    public static void main(String[] args) {
        System.out.println(RedisUtils.setObject("this is jedis for centos"));
    }


}
